package cn.duli.xianer.service.impl;

import cn.duli.xianer.dao.ReceiveAddressMapper;
import cn.duli.xianer.pojo.ReceiveAddress;
import cn.duli.xianer.service.ReceiveAddressService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ReceiveAddressServiceImpl implements ReceiveAddressService {

    @Resource
    private ReceiveAddressMapper receiveAddressMapper;

    @Override
    public void save(ReceiveAddress receiveAddress) {
        receiveAddressMapper.save(receiveAddress);
    }

    @Override
    public void update(ReceiveAddress receiveAddress) {
        receiveAddressMapper.update(receiveAddress);
    }

    @Override
    public void deleteById(Integer raId) {
        receiveAddressMapper.deleteById(raId);
    }

    @Override
    public ReceiveAddress findById(Integer raId) {
        return receiveAddressMapper.findById(raId);
    }

    @Override
    public List<ReceiveAddress> findAll() {
        return receiveAddressMapper.findAll();
    }

    @Override
    public void updateDefault(ReceiveAddress receiveAddress) {
        receiveAddressMapper.updateDefault(receiveAddress);
    }

    @Override
    public List<ReceiveAddress> findByUserId(Integer raUid) {
        return receiveAddressMapper.findByUserId(raUid);
    }
}
